import { Reducer } from 'redux'
import Numstatus from './state'
const reducer: Reducer<any> = (preloadedState = {...Numstatus.state}, action) => {
    let newState = JSON.parse(JSON.stringify(preloadedState))
    for (const key in Numstatus.actionsName) {
        if (action.type === Numstatus.actionsName[key]) {
            Numstatus.actions[Numstatus.actionsName[key]](newState,action)
            return newState
        }
    }
    return preloadedState;
}
export default reducer